home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / PowerPlant / BlueLibrary Pack1 v1.1 / BlueLibrary Pack1 ƒ / BD Common ƒ / CDividedView.h < prev    next >
Text File  |  1996-04-22  |  2KB  |  73 lines

  1. // ===========================================================================
  2. //    CDividedView.cp
  3. //    Written by Christophe Causer
  4. //    ©1996 BlueDays Software.  All Rights Reserved.
  5. //
  6. //    You may use this class in any non-commercial program without
  7. //    permission.  The only restriction is that you must credit the
  8. //    author in your about box.  For commercial use, please contact
  9. //    the author at the email address below.
  10. //                    
  11. //    Send bug-reports and comments to bluedays@kagi.com
  12. //
  13. // ===========================================================================
  14.  
  15. #pragma once
  16.  
  17. #include <LView.h>
  18.  
  19. #pragma options align=mac68k
  20.  
  21. typedef struct SDividerInfo {
  22.     PaneIDT    topLeftPaneID;
  23.     PaneIDT    bottomRightPaneID;
  24.     Int16    topLeftMinSize;
  25.     Int16    bottomRightMinSize;
  26.     Int16    topLeftPaneBorderSize;
  27.     Int16    bottomRightPaneBorderSize;
  28.     Int32    dividerPos;
  29.     Int8    isHorizontal;
  30. } SDividerInfo;
  31.  
  32. #pragma options align=reset
  33.  
  34. class CDividedView : public LView
  35. {
  36.  
  37.     public:
  38.         enum {class_ID = 'divv'};
  39.     
  40.         static    CDividedView*     CreateDividedViewStream(LStream *inStream);
  41.                                 CDividedView(LStream *inStream);
  42.         virtual                    ~CDividedView();
  43.  
  44.         virtual            void    FinishCreateSelf();
  45.  
  46.         virtual            void    DrawSelf();
  47.         virtual            void    ClickSelf(const SMouseDownEvent &inMouseDown);
  48.         
  49.         virtual            void    AdjustCursorSelf(Point inPortPt, const EventRecord &inMacEvent);
  50.         virtual            void    ResizeFrameBy(Int16 inWidthDelta, Int16 inHeightDelta, Boolean inRefresh);
  51.                 
  52.     protected:
  53.         Cursor            mHCursor;
  54.         Cursor            mVCursor;
  55.  
  56.         LPane            *mTopLeftPane;            // top or left view
  57.         LPane            *mBottomRightPane;        // bottom or right view
  58.         PaneIDT            mTopLeftPaneID;            // top or left view
  59.         PaneIDT            mBottomRightPaneID;        // bottom or right view
  60.     
  61.         Int16            mDividerPos;            // where is the divider?
  62.         Int16            mMinTopLeftSize;        // mimimum size of top (or left) pane
  63.         Int16            mMinBottomRightSize;    // minimum size of bottom (or right) pane
  64.         Int16            mTopLeftPaneBorderSize;
  65.         Int16            mBottomRightPaneBorderSize;
  66.         Boolean            mIsHorizontal;            // top/bottom or left/right configuration?
  67.  
  68.     private:
  69.         virtual            void    MoveDividerBy(Int16 inDelta);
  70.         virtual            void    MoveDividerTo(Int16 inPosition);
  71.         virtual            void    CalcDividerRect(Rect &outRect);
  72. };
  73.